home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Software 2000
/
Software 2000 Volume 1 (Disc 1 of 2).iso
/
education
/
e126.dms
/
e126.adf
/
MyMenu.Docs.pp
/
MyMenu.Docs
Wrap
Text File
|
1993-03-10
|
5KB
|
140 lines
MyMenu is a program to allow you to create your own menus in the WorkBench
to run your own commands. This can save the hassle of opening up lots
of drawers to get to the command you want. MyMenu will allow you to execute
both CLI and WorkBench programs, and is configured with a normal text
file. There are probably a few Amiga programming rules violated, but
hopefully, this program will be obsolete when WorkBench 1.4 is released,
since I hear this capability may be added.
Building:
There is a supplied Makefile, which works with Manx 3.6, and a version
of make from a Fish disk (I don't remember which one). The Makefile
should work with most make programs. I haven't tried to get this
to work with 16-bit integers, or to work with Lattice (although, I
would like this).
There are some defines in MyMenu.h that can be customized. DO_WB
determines if support for WorkBench programs is included. Undefining
this can save a lot of space if you don't need this option. DO_PATH
if defined will compile in code for path searching for commands.
Currently, it is undefined.
Installation:
Copy MyMenu-Handler to the L: directory. MyMenu will also look
for this file in the current directory if it does not exist in
the L: directory.
Create the file S:MyMenu.conf. The format of this file is described
later.
Running:
Step one is to start up the Workbench!
The command "MyMenu" will load and start up the handler process.
Menus should now appear in the WorkBench menu strip.
Running MyMenu while the handler is already loaded will cause
it to re-parse the configuration file and rebuild the menus.
The command "MyMenu quit" will terminate and unload the handler
process.
Configuration file:
The configuration file is read in when you run MyMenu. It is
looked for in the S: directory, and in the current directory in
that order.
The configuration file defines the menus you want, and what commands
they will run. You may put carriage returns between keywords, but
you cannot put a carriage return in the middle of a command.
Comments begin with a #, and continue until the end of the line.
Upper and lowercase does not make a difference.
COLOR n
This will set the foreground pen color for new menus. You can
change this as often as you want. The arguments is number that is
the pen number to use. The default is 2 (black).
MENU [<command-char>] menu-name item-name [sub-item-name] | command-def
Defines a new menu. Each menu definition must have a menu-name and
an item-name. A sub-item-name is optional. If any of these names
contain whitespace, enclose the name in double quotes, or precede
the whitespace character with a backslash (\). A command character
may be defined for the menu item by putting the character after the
MENU keyword and surround it with <>'s.
Separate the menu definition and the command definition with a vertical
bar (|). After the bar, you can have the keywords CLI or WB, to
specify that the command is a CLI or WorkBench command. Everything
after WB until the end of the line is taken to be the command.
Everything after CLI until a space or end of the line is taken to be
the command. Everything else will be passed as arguments to the
CLI command. Do not include redirection in a CLI command.
Examples:
menu Games Tetrix | WB dh0:games/tetrix
This will define a menu "Games", with a menu item "Tetrix".
If this is selected, the command "dh0:games/tetrix" will be run
as a WorkBench program.
menu <B> Games "Black Box" | WB df0:Black Box
This will define a menu item "Black Box" under the menu "Games".
The menu Games will already exist from the previous example, and
will now contain "Tetrix" and "Black Box" as items. The command
to be run is "df0:Black Box" (Box is not an argument).
The menu can also be selected by typing <Amiga>-B.
color 3
menu Utilities DMouse "Start DMouse" | c:DMouse
menu Utilities DMouse "Quit DMouse" | c:DMouse quit
This will define two sub menu items (drawn in yellow). The second
command has an argument.
Future plans and hopeless dreams:
AREXX support.
Fix up path searching.
A better parser.
Support for graphical menu items.
Limitations, bugs, and other wierd things:
Path searching does not work. Do not compile this in.
I would appreciate it if someone can find the problem, since I
am stuck. Details are in DoRun.c.
New preferences causes menus to disappear (but handler is not unloaded).
The menus can be rebuilt by running MyMenu again.
Redirection can not be done for CLI programs, since the code already
does redirection to and from NIL:.
Line limit of 256 characters in configuration file.
Acknowledgements:
I have borrowed ideas and code snipits from other public domain
programs. I have also received help directly from some people.
I would like to thank those people (whose names I remember):
Matt Dillon - Ideas for menu building and how to load in the
handler were taken from DME and DMouse.
Peter da Silva - Ideas taken from wblaunch program.
Rob Peck - Some ideas and help.
Davide Cervone - LOTS of ideas taken from MonIDCMP.
Signature:
Darin Johnson
darin@laic.UUCP
{leadsv!laic!darin@pyramid.pyramid.com}
(415) 368-0972